package com.servlet;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dao.UserDao;
import com.helper.DBHelper;
import com.model.User;

@WebServlet("/servlet/LogoutServlet")
public class LogoutServlet extends HttpServlet  {

	protected void doGet(HttpServletRequest request, 
						  HttpServletResponse response) 
    throws IOException, ServletException
	{
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html; charset=UTF-8");
		
		request.getSession().removeAttribute("isAdmin");
		request.getSession().removeAttribute("userName");
		request.getSession().removeAttribute("userNumber");
		request.getSession().removeAttribute("num");
		request.getSession().removeAttribute("currExam");
		request.getSession().removeAttribute("currQuestion");
		request.getSession().removeAttribute("VerifyCode");

		
		request.getRequestDispatcher("/index.jsp")
			.forward(request, response);
	}

}
